package com.shenmazg6.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 产品表
 * @TableName tb_product
 */
@TableName(value ="tb_product")
@Data
@Document(indexName = "tb_product")
public class TbProduct implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    @Id
    private Integer productId;

    /**
     * 产品名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String productName;

    /**
     * 产品类型
     */
    @Field(type = FieldType.Integer)
    private Integer typeId;

    /**
     * 产品SPU
     */
    @Field(type = FieldType.Keyword)
    private String productSpu;

    /**
     * 产品封面
     */
    @Field(type = FieldType.Keyword)
    private String productCover;

    /**
     * 产品描述
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String productDesc;

    /**
     * 评论总数
     */
    @Field(type = FieldType.Integer)
    private Integer commentCount;

    /**
     * 删除状态0：未删除1：已删除
     */
    @Field(type = FieldType.Integer)
    private Integer deleted;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}